package com.santu.edu.supporter.biz.team.service.impl;

import com.santu.edu.supporter.biz.team.dao.UserTeamDao;
import com.santu.edu.supporter.biz.team.pojo.dto.UserTeamDTO;
import com.santu.edu.supporter.biz.team.pojo.param.UserTeamAddParam;
import com.santu.edu.supporter.biz.team.service.UserTeamService;
import com.santu.edu.supporter.util.UuidUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author luoyaoqi
 * @createTime 2024/3/7
 * @description
 */
@Service
@RequiredArgsConstructor
public class UserTeamServiceImpl implements UserTeamService {

    private final UserTeamDao userTeamDao;

    @Override
    public Boolean addTeam(UserTeamAddParam addParam) {
        String temId = UuidUtils.getUuid(8);
        UserTeamDTO dto = UserTeamDTO.create(addParam, temId);
        userTeamDao.addTeam(dto);
        return true;
    }

    @Override
    public UserTeamDTO getTeamById(String teamId) {
        return userTeamDao.getTeamById(teamId);
    }
}
